package com.cyt.sys.model.po;

import cn.hutool.core.date.DateTime;
import com.cyt.base.util.BaseUtil;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * @param
 * @author changzheng hou
 * @return
 * @date 2019/4/2 14:06
 */
@Getter
@Setter
@Table(name="base_user_role")
public class SysUserRole implements Serializable {

    /*
     * 主键
     */
    @Id
    private String id;

    /**
     * 用户id
     */
    @Column(name="user_id")
    private String userId;

    /**
     * 角色id
     */
    @Column(name="role_id")
    private String roleId;

    /**
     * 创建时间
     */
    @Column(name="create_time")
    private Date createTime;

    public SysUserRole(){}

    public SysUserRole(String userId, String roleId) {
        this.id = BaseUtil.uId();
        this.roleId = roleId;
        this.userId = userId;
        this.createTime = new DateTime();
    }
}